<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>


<html:html>
<head>
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/help/help.css" />
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/stkissue2.css" />
</head>


<body>

<div id="wrapper">
	<!-- 
		<div id="header"><img src="images/kiuchilogo.png" width="305" height="80" /></div>
	 -->	 
	<div id="menu">
	    <ul id="nav">

	    </ul>
	    	
	  </div>
	  
	<div id="content">
		<div id="menuNav"><a href="<%=request.getContextPath() %>/Login.do?mode=check" >หน้าหลัก</a> 
		 >> คลังพัสดุ - Store กลาง  >> บันทึกใบเบิก >> รายการรอจ่าย (ของเบิก)  </div><br />
		
	<center>
		<div>
			
			<form action="/ittl/stkissue/stkissue.do?mode=showFind" method="post" name="formSearch">
			<label>ค้นหาใบขอเบิก พ.1 แผนก</label>			
			<select name="deptFind" size="6" id="deptFind">
				<option value="ALL">ทุกแผนก</option>
				<option value="F1-CC">F1-CC</option>
				<option value="F1-DF">F1-DF</option>
				<option value="F1-FW">F1-FW</option>
				<option value="F1-GA">F1-GA</option>
				<option value="F1-NP">F1-NP</option>
				<option value="F1-PM">F1-PM</option>
				<option value="F1-SP">F1-SP</option>
				<option value="F1-ST">F1-ST</option>
				<option value="F1-SW">F1-SW</option>
				<option value="F1-WM">F1-WM</option>
				<option value="F1-YD">F1-YD</option>
				<option value="F2-GA">F2-GA</option>
				<option value="F2-PM">F2-PM</option>
				<option value="F2-SP">F2-SP</option>
				<option value="F2-ST">F2-ST</option>												
			</select>					
			เดือน			
			<select name="monthFind" size="6" id="monthFind">				
				<option value="01">มกราคม</option>
				<option value="02">กุมภาพันธ์</option>
				<option value="03">มีนาคม</option>
				<option value="04">เมษายน</option>
				<option value="05">พฤษภาคม</option>
				<option value="06">มิถุนายน</option>
				<option value="07">กรกฎาคม</option>
				<option value="08">สิงหาคม</option>
				<option value="09">กันยายน</option>
				<option value="10">ตุลาคม</option>
				<option value="11">พฤศจิกายน</option>
				<option value="12">ธันวาคม</option>												
			</select>
			<select name="yearFind" id="yearFind">
				<option value="53">2553</option>
				<option value="54">2554</option>
				<option value="55">2555</option>
			</select>						
			<input type="submit" value="search">											
			</form>

			<form action="/ittl/stkissue/stkissue.do?mode=showFind" method="post" name="formSearch2">
				ค้นหาเลขที่ใบ พ.1
			<input type="text" value="${docNoFind }" name="docNoFind">
			<input type="submit" value="search">
			</form>
				
		</div><br />	
	
		รายการ พ.1 (ขอเบิก) แผนก:<strong><label id="dept"></label></strong>
		                                         เดือน:<strong><label id="mm"></label> <label id="yyyy"></label></strong><br />
		<div id="tblShow" >
						
			<display:table  name="${stkIssueData}" pagesize="50"
							requestURI=""
							decorator="com.ttl.bc.ic.stkissue.bean.BCStkIssueDecorator"			  
							>
				<display:column property="mode" style="width: 8%" />							
				<display:column property="docNo" 		style="width: 7%" sortable="true" group="1"/>

				<display:column property="itemCode" 	style="width: 5%; text-align: center" sortable="true" title="Item"/>
				<display:column property="itemName" 	style="width: 20%" sortable="true" title="Name"/>
				<display:column property="qty" title="Qty"	style="width: 2%; text-align: right"  format="{0,number, #,###} " />
				<display:column property="ittl_unitName" title="Unit"  style="width: 2%"/>
				<display:column property="ittl_status" title = "Status" style="width: 5%" />
		
								
			</display:table>			
		</div>	 		
	</center>
     
  	</div>
  		  
</div>
<input type="hidden" value="${monthFind }" id="monthFindId">
<input type="hidden" value="${yearFind }" id="yearFindId">
<input type="hidden" value="${deptFind }" id="deptFindId">
<script type="text/javascript">

	var mm = document.getElementById("monthFindId").value;		
	document.formSearch.monthFind[mm-1].selected=true;		
	document.getElementById("mm").innerHTML = document.formSearch.monthFind[mm-1].text;

	var yy = document.getElementById("yearFindId").value;	
	document.formSearch.yearFind[0].selected=true;		
	var dd = document.formSearch.yearFind.selectedIndex;
	var ss = document.formSearch.yearFind[dd].text; 			
	document.getElementById("yyyy").innerHTML = ss;

	var dept = document.getElementById("deptFindId").value;
	var dt = 0;
	var mySelect = document.getElementById("deptFind");	
	for(var i=0; i<mySelect.options.length; i++) {
		if(mySelect.options[i].value==dept) {
			mySelect.options[i].selected = true;
			dt=i;
			break;
		}else {
			mySelect.options[0].selected = true;
		}
	}		
	var s2 = document.formSearch.deptFind[dt].text;
	document.getElementById("dept").innerHTML = s2;	
	 	
</script>

	
</body>

</html:html>